require 'rubygems'
require 'net/http'
require 'search_results'
require 'cgi'

module GoogleSearch
  class Client
    def initialize
    end

    def search_for(search_string)
      search_string = CGI.escape search_string
      GoogleSearch::Results.parse Net::HTTP.get(URI.parse("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=#{search_string}"))
    end
  end
end
